4.2 Main runs
# only keep data of E1
df_univar_E1 <- {
df_clean_univar %>%
filter(ExpCode == 1) %>%
mutate(FaceWord = factor(FaceWord, levels = facewordOrder),
SubjCode = as.factor(SubjCode))
}
df_univar_agg_E1 <- {
df_univar_agg %>%
filter(ExpCode == 1) %>%
mutate(FaceWord = factor(FaceWord, levels = facewordOrder),
SubjCode = as.factor(SubjCode))
}
# only keep data of E1
df_mvpa_E1 <- {
df_clean_mvpa %>%
filter(ExpCode == 1) %>%
mutate(ClassifyPair = factor(ClassifyPair, levels = pairOrder_E1),
SubjCode = as.factor(SubjCode))
}
df_mvpa_acc_E1 <- {
df_mvpa_acc %>%
filter(ExpCode == 1) %>%
mutate(ClassifyPair = factor(ClassifyPair, levels = pairOrder_E1),
SubjCode = as.factor(SubjCode))
}
desc_mvpa_acc_E1 <- {
desc_mvpa_acc %>%
filter(ExpCode == 1) %>%
mutate(ClassifyPair = factor(ClassifyPair, levels = pairOrder_E1)) %>%
arrange(ExpCode, Hemisphere, Label, ClassifyPair)
}
4.2.1 Label:FFA
# label_lFFA_E1 <- label_lFFA[1] # "roi.lh.f20.f-vs-o.label" "roi.lh.f40.f-vs-o.label"
# label_rFFA_E1 <- label_rFFA[1] # "roi.rh.f20.f-vs-o.label" "roi.rh.f40.f-vs-o.label"
label_FFA_E1 <- c(label_lFFA_E1, label_rFFA_E1)
The label used for left FFA in Experiment 1 is roi.lh.f20.f-vs-o.label.
The label used for right FFA in Experiment 1 is roi.rh.f20.f-vs-o.label.
# only keep data for these two labels
df_univar_E1_FFA <- filter(df_univar_E1, Label %in% label_FFA_E1)
df_univar_agg_E1_FFA <- filter(df_univar_agg_E1, Label %in% label_FFA_E1)
df_mvpa_E1_FFA <- filter(df_mvpa_E1, Label %in% label_FFA_E1)
df_mvpa_acc_E1_FFA <- filter(df_mvpa_acc_E1, Label %in% label_FFA_E1)
desc_mvpa_acc_E1_FFA <- filter(desc_mvpa_acc_E1, Label %in% label_FFA_E1)
# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA %>% filter(Label == label_rFFA_E1))$SubjCode))
desc_mvpa_acc_E1_FFA %>%
select(ExpCode, Label, Count) %>%
distinct()
4.2.1.1 Univariate analyses
4.2.1.1.1 rm-ANOVA
4.2.1.1.1.1 Left FFA
anova_E1_lFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA, Label == label_lFFA_E1))
anova_E1_lFFA
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 11 0.19 2.92 .03 .12
## 2 Layout 2.20, 24.17 0.03 7.35 ** .03 .003
## 3 FaceWord:Layout 2.19, 24.14 0.06 0.60 .004 .57
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_lFFA <- emmeans(anova_E1_lFFA, ~ FaceWord * Layout)
emm_anova_E1_lFFA %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_lFFA, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.153 0.0899 11 1.707 0.1158
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.0952 0.0462 33 2.061 0.1871
## intact - top 0.2145 0.0462 33 4.643 0.0003
## intact - bottom 0.0794 0.0462 33 1.720 0.3300
## exchange - top 0.1193 0.0462 33 2.583 0.0656
## exchange - bottom -0.0158 0.0462 33 -0.341 0.9861
## top - bottom -0.1350 0.0462 33 -2.924 0.0301
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_lFFA <- contrast(emm_anova_E1_lFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.23780 0.1170 27.2 2.033 0.0519
## exchange . face - word 0.17662 0.1170 27.2 1.510 0.1426
## top . face - word 0.10059 0.1170 27.2 0.860 0.3974
## bottom . face - word 0.09870 0.1170 27.2 0.844 0.4062
## . face intact - exchange 0.12577 0.0766 61.4 1.641 0.1059
## . face intact - top 0.28306 0.0766 61.4 3.693 0.0005
## . face intact - bottom 0.14897 0.0766 61.4 1.944 0.0565
## . face exchange - top 0.15729 0.0766 61.4 2.052 0.0444
## . face exchange - bottom 0.02320 0.0766 61.4 0.303 0.7631
## . face top - bottom -0.13409 0.0766 61.4 -1.750 0.0852
## . word intact - exchange 0.06459 0.0766 61.4 0.843 0.4027
## . word intact - top 0.14585 0.0766 61.4 1.903 0.0617
## . word intact - bottom 0.00987 0.0766 61.4 0.129 0.8980
## . word exchange - top 0.08126 0.0766 61.4 1.060 0.2932
## . word exchange - bottom -0.05472 0.0766 61.4 -0.714 0.4780
## . word top - bottom -0.13598 0.0766 61.4 -1.774 0.0810
4.2.1.1.1.2 Right FFA
anova_E1_rFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA, Label == label_rFFA_E1))
anova_E1_rFFA
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 15 0.28 21.21 *** .12 .0003
## 2 Layout 2.51, 37.67 0.03 10.53 *** .02 <.0001
## 3 FaceWord:Layout 2.12, 31.84 0.06 3.85 * .01 .03
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_rFFA <- emmeans(anova_E1_rFFA, ~ FaceWord * Layout)
emm_anova_E1_rFFA %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_rFFA, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.427 0.0927 15 4.606 0.0003
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.1822 0.0402 45 4.529 0.0002
## intact - top 0.1980 0.0402 45 4.922 0.0001
## intact - bottom 0.1692 0.0402 45 4.206 0.0007
## exchange - top 0.0158 0.0402 45 0.393 0.9792
## exchange - bottom -0.0130 0.0402 45 -0.324 0.9881
## top - bottom -0.0288 0.0402 45 -0.716 0.8900
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_rFFA <- contrast(emm_anova_E1_rFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.63714 0.1117 29.6 5.702 <.0001
## exchange . face - word 0.34458 0.1117 29.6 3.084 0.0044
## top . face - word 0.38306 0.1117 29.6 3.428 0.0018
## bottom . face - word 0.34325 0.1117 29.6 3.072 0.0045
## . face intact - exchange 0.32852 0.0649 85.4 5.062 <.0001
## . face intact - top 0.32508 0.0649 85.4 5.009 <.0001
## . face intact - bottom 0.31616 0.0649 85.4 4.872 <.0001
## . face exchange - top -0.00344 0.0649 85.4 -0.053 0.9579
## . face exchange - bottom -0.01236 0.0649 85.4 -0.190 0.8495
## . face top - bottom -0.00892 0.0649 85.4 -0.137 0.8910
## . word intact - exchange 0.03596 0.0649 85.4 0.554 0.5810
## . word intact - top 0.07101 0.0649 85.4 1.094 0.2770
## . word intact - bottom 0.02227 0.0649 85.4 0.343 0.7323
## . word exchange - top 0.03505 0.0649 85.4 0.540 0.5905
## . word exchange - bottom -0.01369 0.0649 85.4 -0.211 0.8335
## . word top - bottom -0.04874 0.0649 85.4 -0.751 0.4547
4.2.1.1.2 Plot
sig_uni_E1_FFA <- c(signif(as.data.frame(contr_anova_E1_lFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6),
signif(as.data.frame(contr_anova_E1_rFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA <- sig_colors(sig_uni_E1_FFA)
# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA), as.data.frame(emm_anova_E1_rFFA)))
plot_uni_E1_FFA <- {
ggplot(data = desp_uni_E1_FFA, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(FaceWord ~ .) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) + # remove the space between columns and x axis
labs(title = "", x = "Hemisphere", y = "Beta values") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_uni_E1_FFA, color = color_uni_E1_FFA, size = sig_size, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
general_theme
}
plot_uni_E1_FFA
4.2.1.2 Multivarate analyses (MVPA)
4.2.1.2.1 One-sample t-test
df_mvpa_agg_E1_FFA <- {
df_mvpa_acc_E1_FFA %>%
spread(ClassifyPair, Accuracy) %>% # change to table (each row is one subject)
select(-c(ExpCode, Label, SubjCode, Count)) # remove these columns
}
one_mvpa_agg_E1_lFFA <- {
df_mvpa_agg_E1_FFA %>%
filter(Hemisphere == "left") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_lFFA
## face_intact-word_intact face_intact-face_exchange
## statistic 5.075047 1.260792
## parameter 11 11
## p.value 0.0001788726 0.1167349
## conf.int Numeric,2 Numeric,2
## estimate 0.7 0.5416667
## null.value 0.5 0.5
## stderr 0.03940851 0.03304802
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 0.8043997 -0.7956717
## parameter 11 11
## p.value 0.2191029 0.7784727
## conf.int Numeric,2 Numeric,2
## estimate 0.5333333 0.4666667
## null.value 0.5 0.5
## stderr 0.04143877 0.04189332
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 0.6700594
## parameter 11
## p.value 0.2583198
## conf.int Numeric,2
## estimate 0.5166667
## null.value 0.5
## stderr 0.02487342
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
one_mvpa_agg_E1_rFFA <- {
df_mvpa_agg_E1_FFA %>%
filter(Hemisphere == "right") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_rFFA
## face_intact-word_intact face_intact-face_exchange
## statistic 8.380738 2.09687
## parameter 15 15
## p.value 2.417307e-07 0.02668428
## conf.int Numeric,2 Numeric,2
## estimate 0.75625 0.584375
## null.value 0.5 0.5
## stderr 0.03057607 0.04023855
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 2.654051 1.013435
## parameter 15 15
## p.value 0.009022348 0.1634608
## conf.int Numeric,2 Numeric,2
## estimate 0.603125 0.528125
## null.value 0.5 0.5
## stderr 0.0388557 0.02775216
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 0.6065043
## parameter 15
## p.value 0.2766246
## conf.int Numeric,2
## estimate 0.51875
## null.value 0.5
## stderr 0.03091487
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
4.2.1.2.2 Plot
sig_mvpa_agg_E1_FFA <- c(one_sig(one_mvpa_agg_E1_lFFA), one_sig(one_mvpa_agg_E1_rFFA))
color_uni_E1_FFA <- sig_colors(sig_mvpa_agg_E1_FFA)
plot_mvpa_E1_FFA <- {
ggplot(data = desc_mvpa_acc_E1_FFA, aes(y = emmean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(. ~ Hemisphere) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) + # add the line for 0.5 and 1 (y)
scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) + # remove the space between columns and x axis
scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
labs(title = "", x = "Classification Pairs", y = "Accuracy") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_mvpa_agg_E1_FFA, color = color_uni_E1_FFA, size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
general_theme +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
axis.line = element_line(size = 3))
# theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), #
# axis.line = element_line(size = 3))
}
plot_mvpa_E1_FFA
4.2.2 Label:FFA1
# label_lFFA1_E1 <- label_lFFA1[1] # "roi.lh.f13.f-vs-o.ffa1.label" "roi.lh.f20.f-vs-o.ffa1.label"
# label_rFFA1_E1 <- label_rFFA1[1] # "roi.rh.f13.f-vs-o.ffa1.label"
label_FFA1_E1 <- c(label_lFFA1_E1, label_rFFA1_E1)
The label used for left FFA1 in Experiment 1 is roi.lh.f13.f-vs-o.ffa1.label.
The label used for right FFA1 in Experiment 1 is roi.rh.f13.f-vs-o.ffa1.label.
# only keep data for these two labels
df_univar_E1_FFA1 <- filter(df_univar_E1, Label %in% label_FFA1_E1)
df_univar_agg_E1_FFA1 <- filter(df_univar_agg_E1, Label %in% label_FFA1_E1)
df_mvpa_E1_FFA1 <- filter(df_mvpa_E1, Label %in% label_FFA1_E1)
df_mvpa_acc_E1_FFA1 <- filter(df_mvpa_acc_E1, Label %in% label_FFA1_E1)
desc_mvpa_acc_E1_FFA1 <- filter(desc_mvpa_acc_E1, Label %in% label_FFA1_E1)
# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA1 %>% filter(Label == label_rFFA1_E1))$SubjCode))
desc_mvpa_acc_E1_FFA1 %>%
select(ExpCode, Label, Count) %>%
distinct()
4.2.2.1 Univariate analyses
4.2.2.1.1 rm-ANOVA
4.2.2.1.1.1 Left FFA1
anova_E1_lFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA1, Label == label_lFFA1_E1))
anova_E1_lFFA1
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 11 0.28 4.52 + .10 .06
## 2 Layout 2.38, 26.17 0.03 9.19 *** .06 .0005
## 3 FaceWord:Layout 2.32, 25.50 0.04 2.07 .02 .14
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_lFFA1 <- emmeans(anova_E1_lFFA1, ~ FaceWord * Layout)
emm_anova_E1_lFFA1 %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_lFFA1, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.229 0.108 11 2.127 0.0569
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA1, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.0717 0.0459 33 1.564 0.4127
## intact - top 0.2274 0.0459 33 4.958 0.0001
## intact - bottom 0.1510 0.0459 33 3.294 0.0120
## exchange - top 0.1557 0.0459 33 3.395 0.0093
## exchange - bottom 0.0793 0.0459 33 1.730 0.3247
## top - bottom -0.0763 0.0459 33 -1.664 0.3581
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_lFFA1 <- contrast(emm_anova_E1_lFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA1
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.34875 0.1250 19.2 2.789 0.0116
## exchange . face - word 0.15841 0.1250 19.2 1.267 0.2203
## top . face - word 0.28480 0.1250 19.2 2.278 0.0343
## bottom . face - word 0.12388 0.1250 19.2 0.991 0.3341
## . face intact - exchange 0.16687 0.0693 65.0 2.409 0.0189
## . face intact - top 0.25934 0.0693 65.0 3.743 0.0004
## . face intact - bottom 0.26348 0.0693 65.0 3.803 0.0003
## . face exchange - top 0.09247 0.0693 65.0 1.335 0.1866
## . face exchange - bottom 0.09661 0.0693 65.0 1.394 0.1679
## . face top - bottom 0.00414 0.0693 65.0 0.060 0.9526
## . word intact - exchange -0.02347 0.0693 65.0 -0.339 0.7359
## . word intact - top 0.19540 0.0693 65.0 2.820 0.0064
## . word intact - bottom 0.03861 0.0693 65.0 0.557 0.5792
## . word exchange - top 0.21887 0.0693 65.0 3.159 0.0024
## . word exchange - bottom 0.06208 0.0693 65.0 0.896 0.3735
## . word top - bottom -0.15679 0.0693 65.0 -2.263 0.0270
4.2.2.1.1.2 Right FFA1
anova_E1_rFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA1, Label == label_rFFA1_E1))
anova_E1_rFFA1
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 15 0.29 24.99 *** .15 .0002
## 2 Layout 2.03, 30.48 0.07 3.20 + .01 .05
## 3 FaceWord:Layout 2.49, 37.37 0.07 3.57 * .01 .03
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_rFFA1 <- emmeans(anova_E1_rFFA1, ~ FaceWord * Layout)
emm_anova_E1_rFFA1 %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_rFFA1, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.473 0.0947 15 4.999 0.0002
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA1, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.1333 0.054 45 2.469 0.0788
## intact - top 0.1530 0.054 45 2.833 0.0335
## intact - bottom 0.0822 0.054 45 1.523 0.4325
## exchange - top 0.0197 0.054 45 0.364 0.9833
## exchange - bottom -0.0511 0.054 45 -0.945 0.7806
## top - bottom -0.0707 0.054 45 -1.310 0.5616
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_rFFA1 <- contrast(emm_anova_E1_rFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA1
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.71392 0.1206 35.0 5.921 <.0001
## exchange . face - word 0.39410 0.1206 35.0 3.269 0.0024
## top . face - word 0.35859 0.1206 35.0 2.974 0.0053
## bottom . face - word 0.42642 0.1206 35.0 3.537 0.0012
## . face intact - exchange 0.29321 0.0814 88.7 3.601 0.0005
## . face intact - top 0.33064 0.0814 88.7 4.060 0.0001
## . face intact - bottom 0.22600 0.0814 88.7 2.775 0.0067
## . face exchange - top 0.03743 0.0814 88.7 0.460 0.6469
## . face exchange - bottom -0.06722 0.0814 88.7 -0.825 0.4113
## . face top - bottom -0.10464 0.0814 88.7 -1.285 0.2021
## . word intact - exchange -0.02661 0.0814 88.7 -0.327 0.7446
## . word intact - top -0.02469 0.0814 88.7 -0.303 0.7624
## . word intact - bottom -0.06151 0.0814 88.7 -0.755 0.4521
## . word exchange - top 0.00192 0.0814 88.7 0.024 0.9813
## . word exchange - bottom -0.03490 0.0814 88.7 -0.429 0.6693
## . word top - bottom -0.03681 0.0814 88.7 -0.452 0.6523
4.2.2.1.2 Plot
sig_uni_E1_FFA1 <- c(signif(as.data.frame(contr_anova_E1_lFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6),
signif(as.data.frame(contr_anova_E1_rFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA1 <- sig_colors(sig_uni_E1_FFA1)
# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA1))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA1 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA1), as.data.frame(emm_anova_E1_rFFA1)))
plot_uni_E1_FFA1 <- {
ggplot(data = desp_uni_E1_FFA1, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(FaceWord ~ .) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) + # remove the space between columns and x axis
labs(title = "", x = "Hemisphere", y = "Beta values") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_uni_E1_FFA1, color = color_uni_E1_FFA1, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
general_theme
}
plot_uni_E1_FFA1
4.2.2.2 Multivarate analyses (MVPA)
4.2.2.2.1 One-sample t-test
df_mvpa_agg_E1_FFA1 <- {
df_mvpa_acc_E1_FFA1 %>%
spread(ClassifyPair, Accuracy) %>% # change to table (each row is one subject)
select(-c(ExpCode, Label, SubjCode, Count)) # remove these columns
}
one_mvpa_agg_E1_lFFA1 <- {
df_mvpa_agg_E1_FFA1 %>%
filter(Hemisphere == "left") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_lFFA1
## face_intact-word_intact face_intact-face_exchange
## statistic 5.363636 -1.850199
## parameter 11 11
## p.value 0.0001144977 0.9543464
## conf.int Numeric,2 Numeric,2
## estimate 0.7458333 0.4375
## null.value 0.5 0.5
## stderr 0.04583333 0.03378015
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 2.149866 0.9380832
## parameter 11 11
## p.value 0.02732986 0.1841713
## conf.int Numeric,2 Numeric,2
## estimate 0.5958333 0.5333333
## null.value 0.5 0.5
## stderr 0.04457643 0.03553345
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 1.017494
## parameter 11
## p.value 0.165388
## conf.int Numeric,2
## estimate 0.5333333
## null.value 0.5
## stderr 0.03276022
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
one_mvpa_agg_E1_rFFA1 <- {
df_mvpa_agg_E1_FFA1 %>%
filter(Hemisphere == "right") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_rFFA1
## face_intact-word_intact face_intact-face_exchange
## statistic 7.766196 1.649163
## parameter 15 15
## p.value 6.191903e-07 0.05994694
## conf.int Numeric,2 Numeric,2
## estimate 0.790625 0.559375
## null.value 0.5 0.5
## stderr 0.03742179 0.03600311
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 2.595799 -1.4
## parameter 15 15
## p.value 0.01013387 0.909072
## conf.int Numeric,2 Numeric,2
## estimate 0.609375 0.45625
## null.value 0.5 0.5
## stderr 0.04213538 0.03125
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 1.337227
## parameter 15
## p.value 0.1005372
## conf.int Numeric,2
## estimate 0.534375
## null.value 0.5
## stderr 0.02570617
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
4.2.2.2.2 Plot
sig_mvpa_agg_E1_FFA1 <- c(one_sig(one_mvpa_agg_E1_lFFA1), one_sig(one_mvpa_agg_E1_rFFA1))
color_uni_E1_FFA1 <- sig_colors(sig_mvpa_agg_E1_FFA1)
plot_mvpa_E1_FFA1 <- {
ggplot(data = desc_mvpa_acc_E1_FFA1, aes(y = emmean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(. ~ Hemisphere) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) + # add the line for 0.5 and 1 (y)
scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) + # remove the space between columns and x axis
scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
labs(title = "", x = "Classification Pairs", y = "Accuracy") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_mvpa_agg_E1_FFA1, color = color_uni_E1_FFA1, size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
general_theme +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
axis.line = element_line(size = 3))
# theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), #
# axis.line = element_line(size = 3))
}
plot_mvpa_E1_FFA1
4.2.3 Label:FFA2
# label_lFFA2_E1 <- label_lFFA2[1] # "roi.lh.f13.f-vs-o.ffa2.label"
# label_rFFA2_E1 <- label_rFFA2[1] # "roi.rh.f20.f-vs-o.ffa2.label" "roi.rh.f40.f-vs-o.ffa2.label"
label_FFA2_E1 <- c(label_lFFA2_E1, label_rFFA2_E1)
The label used for left FFA2 in Experiment 1 is roi.lh.f13.f-vs-o.ffa2.label.
The label used for right FFA2 in Experiment 1 is roi.rh.f13.f-vs-o.ffa2.label.
# only keep data for these two labels
df_univar_E1_FFA2 <- filter(df_univar_E1, Label %in% label_FFA2_E1)
df_univar_agg_E1_FFA2 <- filter(df_univar_agg_E1, Label %in% label_FFA2_E1)
df_mvpa_E1_FFA2 <- filter(df_mvpa_E1, Label %in% label_FFA2_E1)
df_mvpa_acc_E1_FFA2 <- filter(df_mvpa_acc_E1, Label %in% label_FFA2_E1)
desc_mvpa_acc_E1_FFA2 <- filter(desc_mvpa_acc_E1, Label %in% label_FFA2_E1)
# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA2 %>% filter(Label == label_lFFA2_E1))$SubjCode))
desc_mvpa_acc_E1_FFA2 %>%
select(ExpCode, Label, Count) %>%
distinct()
4.2.3.1 Univariate analyses
4.2.3.1.1 rm-ANOVA
4.2.3.1.1.1 Left FFA2
anova_E1_lFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA2, Label == label_lFFA2_E1))
anova_E1_lFFA2
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 13 0.15 1.20 .010 .29
## 2 Layout 2.18, 28.34 0.03 6.90 ** .02 .003
## 3 FaceWord:Layout 2.65, 34.45 0.05 0.31 .002 .79
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_lFFA2 <- emmeans(anova_E1_lFFA2, ~ FaceWord * Layout)
emm_anova_E1_lFFA2 %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_lFFA2, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.0804 0.0733 13 1.097 0.2925
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA2, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.0589 0.0389 39 1.515 0.4387
## intact - top 0.1686 0.0389 39 4.336 0.0006
## intact - bottom 0.0390 0.0389 39 1.004 0.7479
## exchange - top 0.1097 0.0389 39 2.821 0.0361
## exchange - bottom -0.0198 0.0389 39 -0.511 0.9561
## top - bottom -0.1295 0.0389 39 -3.331 0.0098
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_lFFA2 <- contrast(emm_anova_E1_lFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA2
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.13568 0.1005 36.5 1.351 0.1851
## exchange . face - word 0.04621 0.1005 36.5 0.460 0.6482
## top . face - word 0.09668 0.1005 36.5 0.962 0.3422
## bottom . face - word 0.04317 0.1005 36.5 0.430 0.6699
## . face intact - exchange 0.10362 0.0682 69.5 1.519 0.1334
## . face intact - top 0.18806 0.0682 69.5 2.756 0.0075
## . face intact - bottom 0.08530 0.0682 69.5 1.250 0.2154
## . face exchange - top 0.08444 0.0682 69.5 1.238 0.2200
## . face exchange - bottom -0.01832 0.0682 69.5 -0.269 0.7891
## . face top - bottom -0.10276 0.0682 69.5 -1.506 0.1366
## . word intact - exchange 0.01415 0.0682 69.5 0.207 0.8363
## . word intact - top 0.14905 0.0682 69.5 2.185 0.0323
## . word intact - bottom -0.00722 0.0682 69.5 -0.106 0.9160
## . word exchange - top 0.13490 0.0682 69.5 1.977 0.0520
## . word exchange - bottom -0.02137 0.0682 69.5 -0.313 0.7551
## . word top - bottom -0.15627 0.0682 69.5 -2.290 0.0250
4.2.3.1.1.2 Right FFA2
anova_E1_rFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_FFA2, Label == label_rFFA2_E1))
anova_E1_rFFA2
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 15 0.12 18.38 *** .09 .0006
## 2 Layout 2.39, 35.92 0.05 7.30 ** .04 .001
## 3 FaceWord:Layout 2.35, 35.19 0.05 1.89 .009 .16
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_rFFA2 <- emmeans(anova_E1_rFFA2, ~ FaceWord * Layout)
emm_anova_E1_rFFA2 %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_rFFA2, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word 0.263 0.0614 15 4.287 0.0006
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA2, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.2036 0.0487 45 4.185 0.0007
## intact - top 0.1840 0.0487 45 3.783 0.0025
## intact - bottom 0.1597 0.0487 45 3.281 0.0104
## exchange - top -0.0196 0.0487 45 -0.403 0.9777
## exchange - bottom -0.0440 0.0487 45 -0.904 0.8029
## top - bottom -0.0244 0.0487 45 -0.501 0.9584
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_rFFA2 <- contrast(emm_anova_E1_rFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA2
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word 0.39107 0.0847 42.6 4.619 <.0001
## exchange . face - word 0.17920 0.0847 42.6 2.116 0.0402
## top . face - word 0.26688 0.0847 42.6 3.152 0.0030
## bottom . face - word 0.21625 0.0847 42.6 2.554 0.0143
## . face intact - exchange 0.30956 0.0680 90.0 4.549 <.0001
## . face intact - top 0.24613 0.0680 90.0 3.617 0.0005
## . face intact - bottom 0.24706 0.0680 90.0 3.631 0.0005
## . face exchange - top -0.06343 0.0680 90.0 -0.932 0.3538
## . face exchange - bottom -0.06250 0.0680 90.0 -0.918 0.3608
## . face top - bottom 0.00093 0.0680 90.0 0.014 0.9891
## . word intact - exchange 0.09769 0.0680 90.0 1.436 0.1546
## . word intact - top 0.12194 0.0680 90.0 1.792 0.0765
## . word intact - bottom 0.07224 0.0680 90.0 1.062 0.2912
## . word exchange - top 0.02426 0.0680 90.0 0.356 0.7223
## . word exchange - bottom -0.02545 0.0680 90.0 -0.374 0.7093
## . word top - bottom -0.04970 0.0680 90.0 -0.730 0.4670
4.2.3.1.2 Plot
sig_uni_E1_FFA2 <- c(signif(as.data.frame(contr_anova_E1_lFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6),
signif(as.data.frame(contr_anova_E1_rFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA2 <- sig_colors(sig_uni_E1_FFA2)
# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA2))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA2 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA2), as.data.frame(emm_anova_E1_rFFA2)))
plot_uni_E1_FFA2 <- {
ggplot(data = desp_uni_E1_FFA2, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(FaceWord ~ .) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) + # remove the space between columns and x axis
labs(title = "", x = "Hemisphere", y = "Beta values") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_uni_E1_FFA2, color = color_uni_E1_FFA2, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
general_theme
}
plot_uni_E1_FFA2
4.2.3.2 Multivarate analyses (MVPA)
4.2.3.2.1 One-sample t-test
df_mvpa_agg_E1_FFA2 <- {
df_mvpa_acc_E1_FFA2 %>%
spread(ClassifyPair, Accuracy) %>% # change to table (each row is one subject)
select(-c(ExpCode, Label, SubjCode, Count)) # remove these columns
}
one_mvpa_agg_E1_lFFA2<- {
df_mvpa_agg_E1_FFA2 %>%
filter(Hemisphere == "left") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_lFFA2
## face_intact-word_intact face_intact-face_exchange
## statistic 6.97137 1.863439
## parameter 13 13
## p.value 4.874809e-06 0.04257117
## conf.int Numeric,2 Numeric,2
## estimate 0.6928571 0.5392857
## null.value 0.5 0.5
## stderr 0.02766417 0.02108237
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 0.579135 -0.2275804
## parameter 13 13
## p.value 0.2861985 0.5882437
## conf.int Numeric,2 Numeric,2
## estimate 0.5178571 0.4928571
## null.value 0.5 0.5
## stderr 0.03083416 0.03138609
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic -0.5514468
## parameter 13
## p.value 0.7046598
## conf.int Numeric,2
## estimate 0.4857143
## null.value 0.5
## stderr 0.02590588
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
one_mvpa_agg_E1_rFFA2 <- {
df_mvpa_agg_E1_FFA2 %>%
filter(Hemisphere == "right") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_rFFA2
## face_intact-word_intact face_intact-face_exchange
## statistic 8.860142 2.424871
## parameter 15 15
## p.value 1.19773e-07 0.014204
## conf.int Numeric,2 Numeric,2
## estimate 0.690625 0.5875
## null.value 0.5 0.5
## stderr 0.02151489 0.03608439
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 1.484542 1.772361
## parameter 15 15
## p.value 0.07918746 0.04831956
## conf.int Numeric,2 Numeric,2
## estimate 0.553125 0.540625
## null.value 0.5 0.5
## stderr 0.03578546 0.0229214
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 1.441153
## parameter 15
## p.value 0.08504544
## conf.int Numeric,2
## estimate 0.5375
## null.value 0.5
## stderr 0.02602082
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
4.2.3.2.2 Plot
sig_mvpa_agg_E1_FFA2 <- c(one_sig(one_mvpa_agg_E1_lFFA2), one_sig(one_mvpa_agg_E1_rFFA2))
color_uni_E1_FFA2 <- sig_colors(sig_mvpa_agg_E1_FFA2)
plot_mvpa_E1_FFA2 <- {
ggplot(data = desc_mvpa_acc_E1_FFA2, aes(y = emmean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(. ~ Hemisphere) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) + # add the line for 0.5 and 1 (y)
scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) + # remove the space between columns and x axis
scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
labs(title = "", x = "Classification Pairs", y = "Accuracy") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_mvpa_agg_E1_FFA2, color = color_uni_E1_FFA2, size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
general_theme +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
axis.line = element_line(size = 3))
# theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), #
# axis.line = element_line(size = 3))
}
plot_mvpa_E1_FFA2
4.2.4 Label: left Visual Word Form Area (VWFA)
# label_VWFA_E1 <- label_lVWFA[1] # "roi.lh.f13.w-vs-o.label"
The label used for (left) VWFA in Experiment 1 is roi.lh.f13.w-vs-o.label.
# only keep data for these two labels
df_univar_E1_VWFA <- filter(df_univar_E1, Label %in% label_VWFA_E1)
df_univar_agg_E1_VWFA <- filter(df_univar_agg_E1, Label %in% label_VWFA_E1)
df_mvpa_E1_VWFA <- filter(df_mvpa_E1, Label %in% label_VWFA_E1)
df_mvpa_acc_E1_VWFA <- filter(df_mvpa_acc_E1, Label %in% label_VWFA_E1)
desc_mvpa_acc_E1_VWFA <- filter(desc_mvpa_acc_E1, Label %in% label_VWFA_E1)
# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_VWFA %>% filter(Label == label_VWFA_E1))$SubjCode))
desc_mvpa_acc_E1_VWFA %>%
select(ExpCode, Label, Count) %>%
distinct()
4.2.4.1 Univariate analyses
4.2.4.1.1 rm-ANOVA
anova_E1_VWFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_VWFA, Label == label_VWFA_E1))
anova_E1_VWFA
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 17 0.22 54.76 *** .15 <.0001
## 2 Layout 2.63, 44.73 0.05 2.65 + .005 .07
## 3 FaceWord:Layout 2.54, 43.17 0.04 9.16 *** .01 .0002
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_VWFA <- emmeans(anova_E1_VWFA, ~ FaceWord * Layout)
emm_anova_E1_VWFA %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_VWFA, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word -0.581 0.0785 17 -7.400 <.0001
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_VWFA, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.0298 0.0494 51 0.604 0.9304
## intact - top 0.1305 0.0494 51 2.643 0.0516
## intact - bottom 0.0748 0.0494 51 1.514 0.4366
## exchange - top 0.1007 0.0494 51 2.039 0.1874
## exchange - bottom 0.0450 0.0494 51 0.911 0.7993
## top - bottom -0.0557 0.0494 51 -1.128 0.6739
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_VWFA <- contrast(emm_anova_E1_VWFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_VWFA
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word -0.4644 0.0929 31.7 -4.999 <.0001
## exchange . face - word -0.7228 0.0929 31.7 -7.781 <.0001
## top . face - word -0.4001 0.0929 31.7 -4.307 0.0001
## bottom . face - word -0.7361 0.0929 31.7 -7.923 <.0001
## . face intact - exchange 0.1590 0.0639 98.3 2.489 0.0145
## . face intact - top 0.0983 0.0639 98.3 1.539 0.1271
## . face intact - bottom 0.2106 0.0639 98.3 3.295 0.0014
## . face exchange - top -0.0607 0.0639 98.3 -0.950 0.3445
## . face exchange - bottom 0.0516 0.0639 98.3 0.807 0.4217
## . face top - bottom 0.1123 0.0639 98.3 1.757 0.0821
## . word intact - exchange -0.0994 0.0639 98.3 -1.556 0.1230
## . word intact - top 0.1626 0.0639 98.3 2.545 0.0125
## . word intact - bottom -0.0611 0.0639 98.3 -0.956 0.3415
## . word exchange - top 0.2620 0.0639 98.3 4.100 0.0001
## . word exchange - bottom 0.0383 0.0639 98.3 0.600 0.5499
## . word top - bottom -0.2237 0.0639 98.3 -3.500 0.0007
4.2.4.1.2 Plot
sig_uni_E1_VWFA <- c(signif(as.data.frame(contr_anova_E1_VWFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_VWFA <- sig_colors(sig_uni_E1_VWFA)
plot_uni_E1_VWFA <- {
ggplot(data = as.data.frame(emm_anova_E1_VWFA), aes(y = emmean, x = FaceWord, fill = Layout)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) + # remove the space between columns and x axis
labs(title = "", x = "Stimuli", y = "Beta values") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_uni_E1_VWFA, color = color_uni_E1_VWFA, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
general_theme
}
plot_uni_E1_VWFA
4.2.4.2 Multivarate analyses (MVPA)
4.2.4.2.1 One-sample t-test
df_mvpa_agg_E1_VWFA <- {
df_mvpa_acc_E1_VWFA %>%
spread(ClassifyPair, Accuracy) %>% # change to table (each row is one subject)
select(-c(ExpCode, Label, SubjCode, Count)) # remove these columns
}
one_mvpa_agg_E1_VWFA <- {
df_mvpa_agg_E1_VWFA %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_VWFA
## face_intact-word_intact face_intact-face_exchange
## statistic 8.154403 1.810279
## parameter 17 17
## p.value 1.40538e-07 0.04398233
## conf.int Numeric,2 Numeric,2
## estimate 0.7055556 0.5666667
## null.value 0.5 0.5
## stderr 0.02520792 0.03682675
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 0.9790675 1
## parameter 17 17
## p.value 0.1706376 0.1656664
## conf.int Numeric,2 Numeric,2
## estimate 0.5388889 0.5361111
## null.value 0.5 0.5
## stderr 0.03972034 0.03611111
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 0.1719454
## parameter 17
## p.value 0.4327554
## conf.int Numeric,2
## estimate 0.5055556
## null.value 0.5
## stderr 0.03231
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
4.2.4.2.2 Plot
sig_mvpa_agg_E1_VWFA <- c(one_sig(one_mvpa_agg_E1_VWFA))
color_uni_E1_VWFA <- sig_colors(sig_mvpa_agg_E1_VWFA)
plot_mvpa_E1_VWFA <- {
ggplot(data = desc_mvpa_acc_E1_VWFA, aes(y = emmean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(Hemisphere ~ .) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) + # add the line for 0.5 and 1 (y)
scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) + # remove the space between columns and x axis
scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
labs(title = "", x = "Classification Pairs", y = "Accuracy") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_mvpa_agg_E1_VWFA, color = color_uni_E1_VWFA, size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
general_theme +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
axis.line = element_line(size = 3))
# theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), #
# axis.line = element_line(size = 3))
}
plot_mvpa_E1_VWFA
4.2.5 Label:Lateral Occipital Cortex
# label_lLOC_E1 <- label_lLOC[1] #
# label_rLOC_E1 <- label_rLOC[1] #
label_LOC_E1 <- c(label_lLOC_E1, label_rLOC_E1)
The label used for left LOC in Experiment 1 is roi.lh.f13.o-vs-scr.label.
The label used for right LOC in Experiment 1 is roi.rh.f13.o-vs-scr.label.
# only keep data for these two labels
df_univar_E1_LOC <- filter(df_univar_E1, Label %in% label_LOC_E1)
df_univar_agg_E1_LOC <- filter(df_univar_agg_E1, Label %in% label_LOC_E1)
df_mvpa_E1_LOC <- filter(df_mvpa_E1, Label %in% label_LOC_E1)
df_mvpa_acc_E1_LOC <- filter(df_mvpa_acc_E1, Label %in% label_LOC_E1)
desc_mvpa_acc_E1_LOC <- filter(desc_mvpa_acc_E1, Label %in% label_LOC_E1)
# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_LOC %>% filter(Label == label_lLOC_E1))$SubjCode))
desc_mvpa_acc_E1_LOC %>%
select(ExpCode, Label, Count) %>%
distinct()
4.2.5.1 Univariate analyses
4.2.5.1.1 rm-ANOVA
4.2.5.1.1.1 Left LOC
anova_E1_lLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_LOC, Label == label_lLOC_E1))
anova_E1_lLOC
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 18 0.18 21.31 *** .07 .0002
## 2 Layout 2.10, 37.88 0.05 0.43 .0009 .66
## 3 FaceWord:Layout 2.29, 41.17 0.04 0.03 <.0001 .98
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_lLOC <- emmeans(anova_E1_lLOC, ~ FaceWord * Layout)
emm_anova_E1_lLOC %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_lLOC, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word -0.317 0.0687 18 -4.616 0.0002
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lLOC, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.03553 0.042 54 0.846 0.8323
## intact - top 0.04271 0.042 54 1.017 0.7404
## intact - bottom 0.03793 0.042 54 0.903 0.8033
## exchange - top 0.00718 0.042 54 0.171 0.9982
## exchange - bottom 0.00240 0.042 54 0.057 0.9999
## top - bottom -0.00478 0.042 54 -0.114 0.9995
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_lLOC <- contrast(emm_anova_E1_lLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lLOC
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word -0.32384 0.0844 37.7 -3.836 0.0005
## exchange . face - word -0.30978 0.0844 37.7 -3.669 0.0007
## top . face - word -0.30720 0.0844 37.7 -3.639 0.0008
## bottom . face - word -0.32860 0.0844 37.7 -3.892 0.0004
## . face intact - exchange 0.02850 0.0580 107.8 0.491 0.6243
## . face intact - top 0.03438 0.0580 107.8 0.593 0.5546
## . face intact - bottom 0.04031 0.0580 107.8 0.695 0.4887
## . face exchange - top 0.00589 0.0580 107.8 0.101 0.9194
## . face exchange - bottom 0.01181 0.0580 107.8 0.204 0.8391
## . face top - bottom 0.00592 0.0580 107.8 0.102 0.9189
## . word intact - exchange 0.04256 0.0580 107.8 0.734 0.4648
## . word intact - top 0.05103 0.0580 107.8 0.880 0.3810
## . word intact - bottom 0.03555 0.0580 107.8 0.613 0.5413
## . word exchange - top 0.00847 0.0580 107.8 0.146 0.8842
## . word exchange - bottom -0.00701 0.0580 107.8 -0.121 0.9040
## . word top - bottom -0.01548 0.0580 107.8 -0.267 0.7901
4.2.5.1.1.2 Right LOC
anova_E1_rLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode),
data = filter(df_univar_agg_E1_LOC, Label == label_rLOC_E1))
anova_E1_rLOC
## Anova Table (Type 3 tests)
##
## Response: meanResp
## Effect df MSE F ges p.value
## 1 FaceWord 1, 16 0.25 3.70 + .01 .07
## 2 Layout 2.26, 36.17 0.08 0.71 .002 .52
## 3 FaceWord:Layout 2.40, 38.42 0.05 0.41 .0006 .71
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
##
## Sphericity correction method: GG
emm_anova_E1_rLOC <- emmeans(anova_E1_rLOC, ~ FaceWord * Layout)
emm_anova_E1_rLOC %>%
as.data.frame() %>%
arrange(FaceWord)
contrast(emmeans(emm_anova_E1_rLOC, ~ FaceWord), "pairwise")
## contrast estimate SE df t.ratio p.value
## face - word -0.166 0.0861 16 -1.923 0.0725
##
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rLOC, ~ Layout), "pairwise") # , adjust = "none"
## contrast estimate SE df t.ratio p.value
## intact - exchange 0.082239 0.0595 48 1.381 0.5172
## intact - top 0.060637 0.0595 48 1.018 0.7396
## intact - bottom 0.060014 0.0595 48 1.008 0.7456
## exchange - top -0.021602 0.0595 48 -0.363 0.9835
## exchange - bottom -0.022225 0.0595 48 -0.373 0.9821
## top - bottom -0.000623 0.0595 48 -0.010 1.0000
##
## Results are averaged over the levels of: FaceWord
## P value adjustment: tukey method for comparing a family of 4 estimates
contr_anova_E1_rLOC <- contrast(emm_anova_E1_rLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rLOC
## Layout FaceWord contrast estimate SE df t.ratio p.value
## intact . face - word -0.11262 0.1039 31.7 -1.084 0.2867
## exchange . face - word -0.21399 0.1039 31.7 -2.059 0.0478
## top . face - word -0.15496 0.1039 31.7 -1.491 0.1458
## bottom . face - word -0.18075 0.1039 31.7 -1.739 0.0917
## . face intact - exchange 0.13293 0.0762 91.5 1.745 0.0843
## . face intact - top 0.08181 0.0762 91.5 1.074 0.2856
## . face intact - bottom 0.09408 0.0762 91.5 1.235 0.2199
## . face exchange - top -0.05112 0.0762 91.5 -0.671 0.5038
## . face exchange - bottom -0.03885 0.0762 91.5 -0.510 0.6112
## . face top - bottom 0.01227 0.0762 91.5 0.161 0.8724
## . word intact - exchange 0.03155 0.0762 91.5 0.414 0.6797
## . word intact - top 0.03946 0.0762 91.5 0.518 0.6056
## . word intact - bottom 0.02595 0.0762 91.5 0.341 0.7341
## . word exchange - top 0.00791 0.0762 91.5 0.104 0.9175
## . word exchange - bottom -0.00560 0.0762 91.5 -0.074 0.9415
## . word top - bottom -0.01351 0.0762 91.5 -0.177 0.8596
4.2.5.1.2 Plot
sig_uni_E1_LOC <- c(signif(as.data.frame(contr_anova_E1_lLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6),
signif(as.data.frame(contr_anova_E1_rLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_LOC <- sig_colors(sig_uni_E1_LOC)
# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lLOC))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_LOC <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lLOC), as.data.frame(emm_anova_E1_rLOC)))
plot_uni_E1_LOC <- {
ggplot(data = desp_uni_E1_LOC, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(FaceWord ~ .) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) + # remove the space between columns and x axis
labs(title = "", x = "Hemisphere", y = "Beta values") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_uni_E1_LOC, color = color_uni_E1_LOC, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
general_theme
}
plot_uni_E1_LOC
4.2.5.2 Multivarate analyses (MVPA)
4.2.5.2.1 One-sample t-test
df_mvpa_agg_E1_LOC <- {
df_mvpa_acc_E1_LOC %>%
spread(ClassifyPair, Accuracy) %>% # change to table (each row is one subject)
select(-c(ExpCode, Label, SubjCode, Count)) # remove these columns
}
one_mvpa_agg_E1_lLOC <- {
df_mvpa_agg_E1_LOC %>%
filter(Hemisphere == "left") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_lLOC
## face_intact-word_intact face_intact-face_exchange
## statistic 6.179459 2.117647
## parameter 18 18
## p.value 3.910056e-06 0.02419283
## conf.int Numeric,2 Numeric,2
## estimate 0.7605263 0.5631579
## null.value 0.5 0.5
## stderr 0.04216005 0.02982456
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 3.225275 3.067192
## parameter 18 18
## p.value 0.00234707 0.003319323
## conf.int Numeric,2 Numeric,2
## estimate 0.6184211 0.5789474
## null.value 0.5 0.5
## stderr 0.03671658 0.0257393
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 3.05279
## parameter 18
## p.value 0.003425313
## conf.int Numeric,2
## estimate 0.5921053
## null.value 0.5
## stderr 0.03017085
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
one_mvpa_agg_E1_rLOC <- {
df_mvpa_agg_E1_LOC %>%
filter(Hemisphere == "right") %>%
select(-Hemisphere) %>%
sapply(function(x) t.test(x, mu = 0.5, alternative = "greater")) # apply one-sample t-test to each column separately
}
one_mvpa_agg_E1_rLOC
## face_intact-word_intact face_intact-face_exchange
## statistic 6.830721 1.576527
## parameter 16 16
## p.value 2.019522e-06 0.06723427
## conf.int Numeric,2 Numeric,2
## estimate 0.7764706 0.5470588
## null.value 0.5 0.5
## stderr 0.04047459 0.02984968
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## face_top-face_bottom word_intact-word_exchange
## statistic 3.997233 3.771236
## parameter 16 16
## p.value 0.0005190233 0.0008355743
## conf.int Numeric,2 Numeric,2
## estimate 0.6117647 0.5705882
## null.value 0.5 0.5
## stderr 0.02796052 0.01871753
## alternative "greater" "greater"
## method "One Sample t-test" "One Sample t-test"
## data.name "x" "x"
## word_top-word_bottom
## statistic 3.570283
## parameter 16
## p.value 0.001277334
## conf.int Numeric,2
## estimate 0.6205882
## null.value 0.5
## stderr 0.03377554
## alternative "greater"
## method "One Sample t-test"
## data.name "x"
4.2.5.2.2 Plot
sig_mvpa_agg_E1_LOC <- c(one_sig(one_mvpa_agg_E1_lLOC), one_sig(one_mvpa_agg_E1_rLOC))
color_uni_E1_LOC <- sig_colors(sig_mvpa_agg_E1_LOC)
plot_mvpa_E1_LOC <- {
ggplot(data = desc_mvpa_acc_E1_LOC, aes(y = emmean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
geom_col(position = "dodge", color = "black", alpha = .7) + # position of columns and countour of columns
facet_grid(. ~ Hemisphere) +
geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1, # set the error bar
show.legend = FALSE, width = 0.25, alpha = .5,
position = position_dodge(width=0.9)) +
geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) + # add the line for 0.5 and 1 (y)
scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) + # remove the space between columns and x axis
scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
labs(title = "", x = "Classification Pairs", y = "Accuracy") + # set the names for main, x and y axises Subjective Responses for E205
geom_text(label = sig_mvpa_agg_E1_LOC, color = color_uni_E1_LOC, size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
general_theme +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
axis.line = element_line(size = 3))
# theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), #
# axis.line = element_line(size = 3))
}
plot_mvpa_E1_LOC